﻿using BJ.AuthEntity.Models;
using BJ.AuthEntity.ViewModels;
using Syspetro.Core.AopService;
using Syspetro.Core.AppDeal;
using Syspetro.Core.DbAccessor;
using Syspetro.Core.SysInterface;
using System;
using System.Threading.Tasks;

namespace BJ.AuthDomain.IService
{
    public interface IUserAuthService : IEntityBaseService<UserAuth>, ITransientService
    {
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="loginUser"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [MonitorAttribute]
        Task<SpActionResult<VM_Token>> LoginUser(VM_Login loginUser, UserAuth user = null);
        /// <summary>
        /// 用户登录,并返回用户信息
        /// </summary>
        /// <param name="loginUser"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        Task<SpActionResult<VM_TokenInfo>> LoginUserInfo(VM_Login loginUser, UserAuth user = null);
        /// <summary>
        /// 用户认证登录
        /// </summary>
        /// <param name="loginUser"></param>
        /// <returns></returns>
        Task<SpActionResult<VM_Token>> AuthLoginUser(VM_Login loginUser);
        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="register"></param>
        /// <returns></returns>
        Task<SpActionResult<VM_Token>> Register(VM_Login_Register register);
        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="register"></param>
        /// <returns></returns>
        Task<SpActionResult<VM_TokenInfo>> RegisterInfo(VM_Login_Register register);
        /// <summary>
        /// 获取用户详情
        /// </summary>
        /// <returns></returns>
        Task<SpActionResult<VM_User>> GetUserInfo();
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="userRegister"></param>
        /// <returns></returns>
        Task<SpActionResult<bool>> ChangePswd(VM_ChangePswd changePswd);
        /// <summary>
        /// 忘记密码
        /// </summary>
        /// <param name="forgetPswd"></param>
        /// <returns></returns>
        Task<SpActionResult<VM_Token>> ForgetPswd(VM_Login_Forget forgetPswd);
        /// <summary>
        /// 修改手机号码
        /// </summary>
        /// <param name="changePhone"></param>
        /// <returns></returns>
        Task<SpActionResult<bool>> ChangePhone(VM_ChangePhone changePhone);
        /// <summary>
        /// 刷新Token
        /// </summary>
        /// <param name="tokenId"></param>
        /// <returns></returns>
        Task<string> RefreshToken(Guid tokenId);
        /// <summary>
        /// 退出登录
        /// </summary>
        /// <param name="tokenId"></param>
        /// <returns></returns>
        Task LogOut(Guid tokenId);
        /// <summary>
        /// 查询用户ID
        /// </summary>
        /// <param name="Account"></param>
        /// <returns></returns>
        Task<SpActionResult<Guid>> GetUserId(string Account);
        /// <summary>
        /// 冻结用户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<SpActionResult<bool>> FreezeUser(Guid id);
        /// <summary>
        /// 恢复用户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<SpActionResult<bool>> ResumeUser(Guid id);
    }
}
